package com.jemmyee.pizza.service;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.jemmyee.core.dao.Page;
import com.jemmyee.pizza.dao.ICostPipelineDao;
import com.jemmyee.pizza.entity.CostPipeline;

@Repository("costPipelineService")
public class CostPipelineServiceImpl implements ICostPipelineService<CostPipeline>{

	private static final Log log = LogFactory.getLog(CostPipelineServiceImpl.class) ;
	
	@Autowired
	private ICostPipelineDao costPipelineDao ;
	
	public void delete(CostPipeline entity) {
		costPipelineDao.delete(entity) ;
		
	}

	public void deleteAll(List<CostPipeline> list) {
		costPipelineDao.deleteAll(list) ;
		
	}

	public void deleteById(Serializable id) {
		costPipelineDao.deleteById(id) ;
	}

	public List<CostPipeline> findAll() {
		return costPipelineDao.findAll(new CostPipeline());
	}

	public List<CostPipeline> findByCriteria(DetachedCriteria criteria) {
		return costPipelineDao.findByCriteria(criteria);
	}

	public CostPipeline findById(Serializable id) {
		return costPipelineDao.findById(id);
	}

	public List<CostPipeline> findByProperty(String propertyName, Object value) {
		return costPipelineDao.findByProperty(new CostPipeline(), propertyName, value);
	}

	public Page findPageByCriteria(DetachedCriteria detachedCriteria,
			int pageSize, int startIndex, String order) {
		return costPipelineDao.findPageByCriteria(detachedCriteria, pageSize, startIndex, order);
	}

	public void save(CostPipeline entity) {
		costPipelineDao.save(entity);
	}

	public void update(CostPipeline entity) {
		costPipelineDao.update(entity) ;		
	}

}
